﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.IService;
using System.Data;
using Utility;
using System.Collections;
using System.Data.SqlClient;
using Entity;

namespace DataAccess.Service
{
    public class DepartmentService : IDepartmentService
    {

        public Department selectDepartment(String depName)
        {
            Department department = new Department();
            string commandText = "select * from Department where depName=@depName";
            SqlParameter[] paras = new SqlParameter[]
            {
              new SqlParameter("depName", depName)
            };
            SqlDataReader sdReader = SQLHelper.ExecuteReader(commandText, paras);
            if (sdReader.Read())
            {
                department.DepName = Convert.ToString(sdReader["depName"]);
                department.RecvAccount = Convert.ToString(sdReader["recvAccount"]);
            }
            return department;
        }
        /*public DataSet selectBankImag()
        {
            string commandText = "select * from Bank";
            return SQLHelper.ExecuteDataSet(commandText);
        }*/

        public DataSet selectDepartment()
        {
            string commandText = "select * from Department";
            return SQLHelper.ExecuteDataSet(commandText);
        }

        

        
    }
}
 

